3.1.25 \(\int (c+d x) \csc (a+b x) \, dx\) [25]

Optimal. Leaf size=67 \[ -\frac {2 (c+d x) \tanh ^{-1}\left (e^{i (a+b x)}\right )}{b}+\frac {i d \text {Li}_2\left (-e^{i (a+b x)}\right )}{b^2}-\frac {i d \text {Li}_2\left (e^{i (a+b x)}\right )}{b^2} \]

[Out]

-2*(d*x+c)*arctanh(exp(I*(b*x+a)))/b+I*d*polylog(2,-exp(I*(b*x+a)))/b^2-I*d*polylog(2,exp(I*(b*x+a)))/b^2

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 67, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 3, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {4268, 2317, 2438} \begin {gather*} \frac {i d \text {PolyLog}\left (2,-e^{i (a+b x)}\right )}{b^2}-\frac {i d \text {PolyLog}\left (2,e^{i (a+b x)}\right )}{b^2}-\frac {2 (c+d x) \tanh ^{-1}\left (e^{i (a+b x)}\right )}{b} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(c + d*x)*Csc[a + b*x],x]

[Out]

(-2*(c + d*x)*ArcTanh[E^(I*(a + b*x))])/b + (I*d*PolyLog[2, -E^(I*(a + b*x))])/b^2 - (I*d*PolyLog[2, E^(I*(a +
 b*x))])/b^2

Rule 2317

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 4268

Int[csc[(e_.) + (f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[-2*(c + d*x)^m*(ArcTanh[E^(I*(e + f*
x))]/f), x] + (-Dist[d*(m/f), Int[(c + d*x)^(m - 1)*Log[1 - E^(I*(e + f*x))], x], x] + Dist[d*(m/f), Int[(c +
d*x)^(m - 1)*Log[1 + E^(I*(e + f*x))], x], x]) /; FreeQ[{c, d, e, f}, x] && IGtQ[m, 0]

Rubi steps

\begin {align*} \int (c+d x) \csc (a+b x) \, dx &=-\frac {2 (c+d x) \tanh ^{-1}\left (e^{i (a+b x)}\right )}{b}-\frac {d \int \log \left (1-e^{i (a+b x)}\right ) \, dx}{b}+\frac {d \int \log \left (1+e^{i (a+b x)}\right ) \, dx}{b}\\ &=-\frac {2 (c+d x) \tanh ^{-1}\left (e^{i (a+b x)}\right )}{b}+\frac {(i d) \text {Subst}\left (\int \frac {\log (1-x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^2}-\frac {(i d) \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{i (a+b x)}\right )}{b^2}\\ &=-\frac {2 (c+d x) \tanh ^{-1}\left (e^{i (a+b x)}\right )}{b}+\frac {i d \text {Li}_2\left (-e^{i (a+b x)}\right )}{b^2}-\frac {i d \text {Li}_2\left (e^{i (a+b x)}\right )}{b^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.06, size = 134, normalized size = 2.00 \begin {gather*} -\frac {c \log \left (\cos \left (\frac {a}{2}+\frac {b x}{2}\right )\right )}{b}+\frac {c \log \left (\sin \left (\frac {a}{2}+\frac {b x}{2}\right )\right )}{b}+\frac {d \left ((a+b x) \left (\log \left (1-e^{i (a+b x)}\right )-\log \left (1+e^{i (a+b x)}\right )\right )-a \log \left (\tan \left (\frac {1}{2} (a+b x)\right )\right )+i \left (\text {Li}_2\left (-e^{i (a+b x)}\right )-\text {Li}_2\left (e^{i (a+b x)}\right )\right )\right )}{b^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(c + d*x)*Csc[a + b*x],x]

[Out]

-((c*Log[Cos[a/2 + (b*x)/2]])/b) + (c*Log[Sin[a/2 + (b*x)/2]])/b + (d*((a + b*x)*(Log[1 - E^(I*(a + b*x))] - L
og[1 + E^(I*(a + b*x))]) - a*Log[Tan[(a + b*x)/2]] + I*(PolyLog[2, -E^(I*(a + b*x))] - PolyLog[2, E^(I*(a + b*
x))])))/b^2

________________________________________________________________________________________

Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 123 vs. \(2 (59 ) = 118\).
time = 0.01, size = 124, normalized size = 1.85

method result size
derivativedivides \(\frac {-\frac {d a \ln \left (\csc \left (b x +a \right )-\cot \left (b x +a \right )\right )}{b}+c \ln \left (\csc \left (b x +a \right )-\cot \left (b x +a \right )\right )+\frac {d \left (\left (b x +a \right ) \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right )-\left (b x +a \right ) \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right )+i \dilog \left ({\mathrm e}^{i \left (b x +a \right )}+1\right )-i \dilog \left (1-{\mathrm e}^{i \left (b x +a \right )}\right )\right )}{b}}{b}\) \(124\)
default \(\frac {-\frac {d a \ln \left (\csc \left (b x +a \right )-\cot \left (b x +a \right )\right )}{b}+c \ln \left (\csc \left (b x +a \right )-\cot \left (b x +a \right )\right )+\frac {d \left (\left (b x +a \right ) \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right )-\left (b x +a \right ) \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right )+i \dilog \left ({\mathrm e}^{i \left (b x +a \right )}+1\right )-i \dilog \left (1-{\mathrm e}^{i \left (b x +a \right )}\right )\right )}{b}}{b}\) \(124\)
risch \(-\frac {2 c \arctanh \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b}+\frac {d \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) x}{b}+\frac {d \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) a}{b^{2}}-\frac {i d \polylog \left (2, {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}-\frac {d \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right ) x}{b}-\frac {d \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right ) a}{b^{2}}+\frac {i d \polylog \left (2, -{\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}+\frac {2 d a \arctanh \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}\) \(151\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*x+c)*csc(b*x+a),x,method=_RETURNVERBOSE)

[Out]

1/b*(-1/b*d*a*ln(csc(b*x+a)-cot(b*x+a))+c*ln(csc(b*x+a)-cot(b*x+a))+1/b*d*((b*x+a)*ln(1-exp(I*(b*x+a)))-(b*x+a
)*ln(exp(I*(b*x+a))+1)+I*dilog(exp(I*(b*x+a))+1)-I*dilog(1-exp(I*(b*x+a)))))

________________________________________________________________________________________

Maxima [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 175 vs. \(2 (55) = 110\).
time = 0.34, size = 175, normalized size = 2.61 \begin {gather*} -\frac {2 i \, b d x \arctan \left (\sin \left (b x + a\right ), -\cos \left (b x + a\right ) + 1\right ) - 2 i \, b c \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) - 1\right ) - 2 \, {\left (-i \, b d x - i \, b c\right )} \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) + 1\right ) - 2 i \, d {\rm Li}_2\left (-e^{\left (i \, b x + i \, a\right )}\right ) + 2 i \, d {\rm Li}_2\left (e^{\left (i \, b x + i \, a\right )}\right ) + {\left (b d x + b c\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} + 2 \, \cos \left (b x + a\right ) + 1\right ) - {\left (b d x + b c\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} - 2 \, \cos \left (b x + a\right ) + 1\right )}{2 \, b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*csc(b*x+a),x, algorithm="maxima")

[Out]

-1/2*(2*I*b*d*x*arctan2(sin(b*x + a), -cos(b*x + a) + 1) - 2*I*b*c*arctan2(sin(b*x + a), cos(b*x + a) - 1) - 2
*(-I*b*d*x - I*b*c)*arctan2(sin(b*x + a), cos(b*x + a) + 1) - 2*I*d*dilog(-e^(I*b*x + I*a)) + 2*I*d*dilog(e^(I
*b*x + I*a)) + (b*d*x + b*c)*log(cos(b*x + a)^2 + sin(b*x + a)^2 + 2*cos(b*x + a) + 1) - (b*d*x + b*c)*log(cos
(b*x + a)^2 + sin(b*x + a)^2 - 2*cos(b*x + a) + 1))/b^2

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 252 vs. \(2 (55) = 110\).
time = 0.38, size = 252, normalized size = 3.76 \begin {gather*} \frac {-i \, d {\rm Li}_2\left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) + i \, d {\rm Li}_2\left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - i \, d {\rm Li}_2\left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) + i \, d {\rm Li}_2\left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - {\left (b d x + b c\right )} \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) - {\left (b d x + b c\right )} \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right ) + {\left (b c - a d\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) + {\left (b c - a d\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) - \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) + {\left (b d x + a d\right )} \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) + {\left (b d x + a d\right )} \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right )}{2 \, b^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*csc(b*x+a),x, algorithm="fricas")

[Out]

1/2*(-I*d*dilog(cos(b*x + a) + I*sin(b*x + a)) + I*d*dilog(cos(b*x + a) - I*sin(b*x + a)) - I*d*dilog(-cos(b*x
 + a) + I*sin(b*x + a)) + I*d*dilog(-cos(b*x + a) - I*sin(b*x + a)) - (b*d*x + b*c)*log(cos(b*x + a) + I*sin(b
*x + a) + 1) - (b*d*x + b*c)*log(cos(b*x + a) - I*sin(b*x + a) + 1) + (b*c - a*d)*log(-1/2*cos(b*x + a) + 1/2*
I*sin(b*x + a) + 1/2) + (b*c - a*d)*log(-1/2*cos(b*x + a) - 1/2*I*sin(b*x + a) + 1/2) + (b*d*x + a*d)*log(-cos
(b*x + a) + I*sin(b*x + a) + 1) + (b*d*x + a*d)*log(-cos(b*x + a) - I*sin(b*x + a) + 1))/b^2

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (c + d x\right ) \csc {\left (a + b x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*csc(b*x+a),x)

[Out]

Integral((c + d*x)*csc(a + b*x), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*x+c)*csc(b*x+a),x, algorithm="giac")

[Out]

integrate((d*x + c)*csc(b*x + a), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {c+d\,x}{\sin \left (a+b\,x\right )} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*x)/sin(a + b*x),x)

[Out]

int((c + d*x)/sin(a + b*x), x)

________________________________________________________________________________________